using System;
using System.Collections.Generic;
using System.Text;

namespace Eve.Data
{
    public class TypeReaction : EveAssociation<Type, Type>
    {
        private bool input;
        private int quantity;

        public Type Reaction
        {
            get { return From; }
        }
        public Type Material
        {
            get { return To; }
        }
        public bool Input
        {
            get { return input; }
        }
        public int Quantity
        {
            get { return quantity; }
        }

        internal TypeReaction(DbDataRow dr)
            : base(dr.Database, new Type(dr.Database, dr["reactionTypeID"]), new Type(dr.Database, dr["typeID"]))
        {
            Fill(dr);
        }
        internal TypeReaction(DbDataRow dr, Type reaction)
            : base(dr.Database, reaction, new Type(dr.Database, dr["typeID"]))
        {
            Fill(dr);
        }

        private void Fill(DbDataRow dr)
        {
            input = dr["input"];
            quantity = dr["quantity"];
        }
    }
}
